home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Graf3D.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  2.2 KB  |  102 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Graf3D.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __GRAF3D__
  13. #define __GRAF3D__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.     radConst = 3754936
  23. };
  24.  
  25. typedef Fixed XfMatrix[4][4]; 
  26.  
  27. struct Point3D {
  28.     Fixed x;
  29.     Fixed y;
  30.     Fixed z;
  31. };
  32.  
  33. typedef struct Point3D Point3D;
  34.  
  35. struct Point2D {
  36.     Fixed x;
  37.     Fixed y;
  38. };
  39.  
  40. typedef struct Point2D Point2D;
  41.  
  42. struct Port3D {
  43.     GrafPtr grPort;
  44.     Rect viewRect;
  45.     Fixed xLeft;
  46.     Fixed yTop;
  47.     Fixed xRight;
  48.     Fixed yBottom;
  49.     Point3D pen;
  50.     Point3D penPrime;
  51.     Point3D eye;
  52.     Fixed hSize;
  53.     Fixed vSize;
  54.     Fixed hCenter;
  55.     Fixed vCenter;
  56.     Fixed xCotan;
  57.     Fixed yCotan;
  58.     char filler;
  59.     char ident;
  60.     XfMatrix xForm;
  61. };
  62.  
  63. typedef struct Port3D Port3D;
  64. typedef Port3D *Port3DPtr, **Port3DHandle;
  65.  
  66.  
  67. #ifdef __cplusplus
  68. extern "C" {
  69. #endif
  70. pascal void InitGrf3d(Port3DHandle port); 
  71. pascal void Open3DPort(Port3DPtr port); 
  72. pascal void SetPort3D(Port3DPtr port); 
  73. pascal void GetPort3D(Port3DPtr *port); 
  74. pascal void MoveTo2D(Fixed x,Fixed y); 
  75. pascal void MoveTo3D(Fixed x,Fixed y,Fixed z); 
  76. pascal void LineTo2D(Fixed x,Fixed y); 
  77. pascal void Move2D(Fixed dx,Fixed dy); 
  78. pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  79. pascal void Line2D(Fixed dx,Fixed dy); 
  80. pascal void Line3D(Fixed dx,Fixed dy,Fixed dz); 
  81. pascal void ViewPort(const Rect *r); 
  82. pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom); 
  83. pascal void ViewAngle(Fixed angle); 
  84. pascal void Identity(void); 
  85. pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor); 
  86. pascal void Translate(Fixed dx,Fixed dy,Fixed dz); 
  87. pascal void Pitch(Fixed xAngle); 
  88. pascal void Yaw(Fixed yAngle); 
  89. pascal void Roll(Fixed zAngle); 
  90. pascal void Skew(Fixed zAngle); 
  91. pascal void Transform(const Point3D *src,Point3D *dst); 
  92. pascal short Clip3D(const Point3D *src1,const Point3D *src2,Point *dst1,
  93.     Point *dst2); 
  94. pascal void SetPt3D(Point3D *pt3D,Fixed x,Fixed y,Fixed z); 
  95. pascal void SetPt2D(Point2D *pt2D,Fixed x,Fixed y); 
  96. pascal void LineTo3D(Fixed x,Fixed y,Fixed z); 
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100.  
  101. #endif
  102.